<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
 
class MY_Form_validation extends CI_Form_validation {
 
	public $CI;
 
	function __construct()
	{
		parent::__construct();
 
		$this->CI =& get_instance();
	}
	
	/**
	* Is Price (2 decimal places)
	*
	* @access  public
	* @param   string  $str
	* @return  bool
	*/
	public function is_price($str)
	{
		$this->CI->form_validation->set_message('is_price', 'Please enter a number/decimal(2dp) smaller than $10000.');
	 
		return (bool) preg_match('/^[0-9]{0,4}+(\.[0-9]{0,2})?$/', $str);
	}
		
}